package org.example.myleet.p443;

import org.example.myleet.Utils.Assert;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(6 == solution.compress(parse(new String[]{"a","a","b","b","c","c","c"})));
        Assert.isTrue(1 == solution.compress(parse(new String[]{"a"})));
        Assert.isTrue(4 == solution.compress(parse(new String[]{"a","b","b","b","b","b","b","b","b","b","b","b","b"})));
        Assert.isTrue(11 == solution.compress(parse(new String[]{"a","a","b","b","c","c","c","d","x","1","1","2"})));
    }

    private static char[] parse(String[] input) {
        char[] result = new char[input.length];
        for (int i = 0; i < input.length; ++i) {
            result[i] = input[i].charAt(0);
        }
        return result;
    }
}
